<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
    <div id="event-handling">
        <p>{{message}}</p>
        <button v-on:click='reverseMessage'>反转message</button>
    </div>

    <script>
        const EventHandling={
            data() {
                return {
                    message:'Hello Vue.js你们好吗'
                }
            },
            methods: {
                reverseMessage(){
                    this.message = this.message
                        .split('')
                        .reverse()
                        .join('')
                }
            }
        }
        const app = Vue.createApp(EventHandling)
        app.mount('#event-handling')
    </script>
</body>
</html>